import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
import {generateData} from '../../../elements/tree-antd/generate-data';

@Component({
  selector: 'app-right',
  templateUrl: './right.component.html',
  styleUrls: ['./right.component.less']
})
export class RightComponent implements OnInit {
  active: boolean;
  @Input() componentToolType = '';
  @Input() rightStyleX;
  @Input() rightStyleY;
  @Input() rightStyleW;
  @Input() rightStyleH;
  @Input() rightData;
  @Input() comeList;

  @Output() onChildChange = new EventEmitter<any>();
  @Output() onChildChangeTxt = new EventEmitter<any>();
  @Output() onDelete = new EventEmitter<any>();

  nodes = [];

  constructor() { }

  ngOnInit() {
        generateData(this.nodes, 3, 2, 1);
    }

    onActive($event) {
      console.log($event.node.data.name);
    }
  onChange($event) {
      this.onChildChange.emit($event);
  }

  onChangeTxt($event) {
      this.onChildChangeTxt.emit($event);
  }

  onDeleteComponent() {
      this.onDelete.emit();

  }

  toggle() {
      this.active = !this.active;
  }


}
